<template>
  <HerinContainer
    class="MainCoal-box"
    :delay="1"
    direction="Right"
    title="泵房告警故障分析"
  >
    <!-- tab按钮 -->
    <div slot="tab" class="MainCoal-box-tab">
      <div
        v-for="(item, i) in titletab"
        :key="i"
        :class="['btn', isbtn === item ? 'isbtn' : '']"
        @click="clickTitleTab(item)"
      >
        {{ item }}
      </div>
    </div>
    <!-- 内容区 -->
    <div slot="content" class="MainCoal-box-content">
      <AlarmAnalysis v-if="isbtn === '告警分析'"></AlarmAnalysis>
      <AlarmLogs v-else></AlarmLogs>
    </div>
  </HerinContainer>
</template>

<script>
import HerinContainer from '@/components/HerinContainer';
import AlarmAnalysis from './AlarmAnalysis.vue';
import AlarmLogs from './AlarmLogs.vue';
export default {
  components: {
    HerinContainer,
    AlarmAnalysis,
    AlarmLogs
  },
  data() {
    return {
      titletab: ['告警分析', '告警记录'],
      isbtn: '告警分析'
    };
  },
  computed: {
  },
  mounted() {
  },
  methods: {
    clickTitleTab(item) {
      this.isbtn = item;
    }
  }
};
</script>

<style lang='scss' scoped>
.MainCoal-box {
  &-tab {
    display: flex;
    .btn {
      @include btn;
    }
    .isbtn {
      background-color: rgba(0, 228, 255, 0.2);
      color: $cyan;
    }
  }
}
</style>
